﻿using System.Collections.Generic;
using System.ServiceModel;
using CNF.Common.Base.SimpleOrm.Data;
using CNF.Common.Base.SimpleOrm.Domain;
using CNF.Common.Base.SimpleOrm.Entities;

namespace CNF.Common.Base.SimpleOrm.ServiceProxyies
{
    [ServiceContract]
    public interface IServiceProxy<DataKeyType, EntityType, DataServiceType, DomainType> : IViewServiceProxy<DataKeyType, EntityType, DataServiceType, DomainType>
        where DataKeyType : struct
        where EntityType : BaseEnity<DataKeyType>, new()
        where DataServiceType : BaseDataService<DataKeyType, EntityType>
        where DomainType : BaseDomain, new()
    {
        [OperationContract]
        void Insert(DomainType domain);
        [OperationContract]
        void Update(DomainType domain);
        [OperationContract]
        void Save(DomainType domain);
        [OperationContract]
        void DeleteById(DataKeyType dataKey);
        [OperationContract]
        void Delete(DomainType domain);

        [OperationContract]
        List<DomainType> QueryAll();
 
    }
}
